﻿/* 
 *  <copyright file="RegisterComponentsWithFactory.cs" company="Wesley Jowitt">
 *  
 *  SobrietyEngine: Copyright (c) 2011 Wesley Jowitt
 *  
 *  This software is distributed under a software license.
 *   * As of the creation time of this file, the license in use is the Microsoft Permissive License (Ms-PL) 
 *    * The license can be viewed at:
 *     * License.Txt in the root folder of this project
 *      * http://sobrietyengine.codeplex.com/license
 *       * http://www.microsoft.com/opensource/licenses.mspx
 *       
 *  </copyright>
 *   */


using SobrietyEngine.Components.Common;
using SobrietyEngine.Components.Graphic;
using SobrietyEngine.Components.Paths;
using SobrietyEngine.Components.Physics;
using SobrietyEngine.Components.Physics.Movers;
using SobrietyEngine.Components.Common;

namespace SobrietyEngine.Components
{
    /// <summary>
    /// This class is used to register components with the factory
    /// it is a seperate instantiable class so that we can create all components
    /// in outside tools (such as the actor actorDefinition editor)
    /// </summary>
    static public class RegisterComponentsWithFactory
    {
        /// <summary>
        /// Initializes a new args of the <see cref="RegisterComponentsWithFactory"/> class and registers all components. 
        /// this class is not needed after its initial instatiation
        /// </summary>
        public static void Register()
        {
            //register components with factory

            //Basic Components
            ComponentFactory.Register(new ComponentFactoryBuilder<PositionCmp>());
            ComponentFactory.Register(new ComponentFactoryBuilder<ScaleCmp>());
            ComponentFactory.Register(new ComponentFactoryBuilder<IdCmp>());
            ComponentFactory.Register(new ComponentFactoryBuilder<OrientationCmp>());

            //Path components
            ComponentFactory.Register(new ComponentFactoryBuilder<NextNodeFollower>());


            //Physics Components
                //bodies
            ComponentFactory.Register(new ComponentFactoryBuilder<RectangleBodyCmp>());
            ComponentFactory.Register(new ComponentFactoryBuilder<CircleBodyCmp>());
                //movers
            ComponentFactory.Register(new ComponentFactoryBuilder<LinearImpulseMovementCmp>());
                //other


            //Graphic3D components            
            ComponentFactory.Register(new ComponentFactoryBuilder<ModelCmp>());
            ComponentFactory.Register(new ComponentFactoryBuilder<TexturedQuadCmp>());

            //Graphic2D components
            ComponentFactory.Register(new ComponentFactoryBuilder<Sprite2DCmp>());




            //Unsorted mess components
            /*
            ComponentFactory.Register(new ComponentFactoryBuilder<AttachedToActor>());
            ComponentFactory.Register(new ComponentFactoryBuilder<AttachedPositionUpdater>());
            ComponentFactory.Register(new ComponentFactoryBuilder<AttachedRotationUpdater>());
            //ComponentFactory.Register(new FactoryBuilder<OwnerGuid>("OwnerGuid"));
            ComponentFactory.Register(new ComponentFactoryBuilder<OwningPlayerInfo>());
            ComponentFactory.Register(new ComponentFactoryBuilder<HealthComponent>());
            ComponentFactory.Register(new ComponentFactoryBuilder<TimeToLive>());
            ComponentFactory.Register(new ComponentFactoryBuilder<RemoveActor>());
            ComponentFactory.Register(new ComponentFactoryBuilder<ConstantRotation>());
            ComponentFactory.Register(new ComponentFactoryBuilder<ScrollingBackground>());
            ComponentFactory.Register(new ComponentFactoryBuilder<TimerComponent>());
            ComponentFactory.Register(new ComponentFactoryBuilder<DrawableText>());
            ComponentFactory.Register(new ComponentFactoryBuilder<AnimatedTexture>());
            ComponentFactory.Register(new ComponentFactoryBuilder<RemoveOnLastFrameAnimTex>());
             * */
            
        }
    }
}
